package com.example.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.entity.Driver;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.Map;
import com.example.util.page2;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.SelectKey;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tyhxzy
 * @since 2023-11-03
 */
public interface DriverMapper extends BaseMapper<Driver> {

    Driver update(Driver driver);


    @Select("SELECT opoints,gpoints\n" +
            "FROM driver\n" +
            "WHERE id=#{id}")
    Map findByDid(Integer id);

    @Select("SELECT opoints+gpoints AS zongjifen FROM driver WHERE id=#{id}")
    Map findDAllPoints(Integer id);

    Page<Map> findDriver(Page p1, @Param("xx") page2 Driver);


}
